<?php
require_once("../includes/Admin_notifications.class.php");
require_once("../includes/User.class.php");
require_once("../includes/User_type.class.php");
?>
<script type="text/javascript" src="../scripts/admin.js"></script>

<form name="request_free_time_form" action="request_free_time_DB.php" method="post">
    <table id= "table_radio" >
        <tr>
            <td><input type="radio" name= "choose" value="all" class="choose" /></td>
            <td> check All doctors and teachers</td>
        </tr>
        <tr>
            <td><input type="radio" name= "choose" value="doctors" class="choose" /></td>
            <td>check All doctors</td>
        </tr>
        <tr>
            <td><input type="radio" name= "choose" value="teachers" class="choose" /></td>
            <td>check All teachers</td>
        </tr>
    </table>

    <table id="table">
     <tr>
        <td>check  </td>
        <td>name   </td>
        <td>type   </td>
     </tr>
        <?php
         $rows = User::find_by_sql("SELECT * FROM user where user_type = 2 OR user_type = 3 ORDER BY user_type");
          for ($i = 0 ; $i < count($rows) ; $i++)
           {
		     echo "<tr>
                       <td><input name = \"requests[]\" value = ".$rows[$i]->get_id()." type = \"checkbox\" class=\"checkbox\"/>
                       </td>
                       <td>" . $rows[$i]->get_name() . "</td>
                       <td>" . User_type::find_type_name($rows[$i]->get_user_type())  . "</td>
                   </tr> ";
           }
        ?>
        
	 <tr>
        <td></td>
        <td><input id="submit" type="button" value="Submit" onclick="validate_request_free_time_form()"></td>
     </tr>	
</table>
</form>